Sound level control

ABSTRACT

A system and method for controlling a sound level of a mobile audio device are disclosed herein. In accordance with at least some embodiments, a system includes a transducer, a phase estimator, and a sound level control. The transducer converts an electrical signal applied to the transducer into audible sound. The phase estimator estimates a phase difference between a voltage and a current of the electrical signal applied to the transducer. The sound level control controls the loudness of sound produced by the transducer based, at least in part on the estimated phase difference.

The present application claims priority to and incorporates by referenceEuropean patent application No. 08290795.7, filed on Aug. 21, 2008.

BACKGROUND

The deleterious effects of excessive exposure to high sound levels havebeen long known. Hearing loss or impairment caused by such exposure maybe irreversible in some cases. Fortunately, damage to hearing can beprevented, to a great extent, by reducing exposure to harmful soundlevels and limiting the time period over which a potentially harmfulexposure occurs.

In the past, exposure to excessive sound levels in the workplace hasbeen considered a significant cause of hearing impairment. Consequently,various regulatory measures have been enacted to protect workers fromdangerous levels of sound. More recently, however, the harmful effectsof exposure to high sound levels outside the workplace have becomeapparent.

Mobile audio devices are a ubiquitous fixture of modern society.Cellular telephones, personal music players, portable gaming systems,etc. can generate audio signals at potentially damaging levels. Mobileaudio device are often employed for hours each day. Users often employsuch devices at sound levels that can lead to hearing impairment. Forexample, users of personal music players may unknowingly set devicevolume to produce detrimental sound levels. In some cases, the presenceof background noise levels, e.g., while driving, may cause a user toincrease the output volume of the device to a dangerously high level.

Regulations limiting the output sound level of mobile devices arebecoming increasingly common. Some regulations may, for example, requirea portable device to limit its output sound level to a maximum of 100decibels, 94 decibels etc. Systems that automatically protect mobileequipment users from harmful sound levels are desirable.

SUMMARY

Various systems and methods for controlling a sound level of a mobileaudio device are disclosed herein. In accordance with at least someembodiments, a system includes a transducer, a phase estimator, and asound level control. The transducer converts an electrical signalapplied to the transducer into audible sound. The phase estimatorestimates a phase difference between a voltage and a current of theelectrical signal applied to the transducer. The sound level controlcontrols the loudness of sound produced by the transducer based, atleast in part on the estimated phase difference.

In accordance with at least some other embodiments, a method includesdetermining a phase difference between a voltage and current of anelectrical signal driving a speaker. loudness of a sound produced by thespeaker is adjusted based, at least in part, on the phase difference.

In accordance with yet other embodiments, a mobile audio device includesan audio volume control system. The audio volume control system adjustsaudio output volume based, at least in part, on a distance between anaudio speaker and an auditory canal of a user.

BRIEF DESCRIPTION OF THE DRAWINGS

For a detailed description of exemplary embodiments of the invention,reference will now be made to the accompanying drawings in which:

FIG. 1A shows speaker voltage to speaker current amplitude ratiovariance across frequency for a speaker obstructed, acoustically coupledto free space, or acoustically coupled to the ear of a user inaccordance with various embodiments;

FIG. 1B shows speaker voltage to speaker current phase variance acrossfrequency for a speaker obstructed, acoustically coupled to free space,or acoustically coupled to the ear of a user in accordance with variousembodiments;

FIG. 2 shows an exemplary mobile audio device 200 that that controlsoutput sound pressure level in accordance with various embodiments;

FIG. 3 shows an exemplary block diagram of a phase estimator thatprovides sound level control in a mobile audio device in accordance withvarious embodiments;

FIG. 4 shows an exemplary block diagram of a phase estimator thatprovides sound level control in a mobile audio device in accordance withvarious embodiments;

FIG. 5 shows a flow diagram for a method for controlling output soundlevel in a mobile audio device in accordance with various embodiments;and

FIG. 6 shows a flow diagram for a method for controlling output soundlevel in a mobile audio device in accordance with various embodiments.

NOTATION AND NOMENCLATURE

Certain terms are used throughout the following description and claimsto refer to particular system components. As one skilled in the art willappreciate, computer companies may refer to a component by differentnames. This document does not intend to distinguish between componentsthat differ in name but not function. In the following discussion and inthe claims, the terms “including” and “comprising” are used in anopen-ended fashion, and thus should be interpreted to mean “including,but not limited to . . . . ” Also, the term “couple” or “couples” isintended to mean either an indirect, direct, optical or wirelesselectrical connection. Thus, if a first device couples to a seconddevice, that connection may be through a direct electrical connection,through an indirect electrical connection via other devices andconnections, through an optical electrical connection, or through awireless electrical connection. Further, the term “software” includesany executable code capable of running on a processor, regardless of themedia used to store the software. Thus, code stored in memory (e.g.,non-volatile memory), and sometimes referred to as “embedded firmware,”is included within the definition of software.

DETAILED DESCRIPTION

The following discussion is directed to various embodiments of theinvention. Although one or more of these embodiments may be preferred,the embodiments disclosed should not be interpreted, or otherwise used,as limiting the scope of the disclosure, including the claims. Inaddition, one skilled in the art will understand that the followingdescription has broad application, and the discussion of any embodimentis meant only to be exemplary of that embodiment, and not intended tointimate that the scope of the disclosure, including the claims, islimited to that embodiment.

Disclosed herein are a system and method for controlling the loudness ofsound output by a mobile audio device. To prevent damage to the hearingof mobile audio device users, various government regulations are beingenacted to limit mobile audio device sound output. The European StandardEN 50332-2:200, entitled “Sound system equipment: Headphones andearphones associated with portable audio equipment—Maximum soundpressure level measurement methodology and limit considerations—” is oneexample of such a regulation. EN 50332 specifies a maximum soundpressure level and electrical output for mobile audio devices, includingheadphones and earphones associated with the players. One method oflimiting sound level output from a portable device involves limitingspeaker output power to a maximum value under all conditions. Forexample, speaker drive may be limited to produce a maximum soundpressure with in-ear headphones. The limitation is applied to alllistening conditions. While effectively limiting sound pressure level,such a solution is fails to account for varying sound pressure levelsthat result from different positioning of the speaker relative to theuser's ear. For example, the sound pressure level experienced by a userdiffers based on the distance between the user's ear and a speaker.

Embodiments of the present disclosure perform acoustic impedancemeasurements to provide the mobile audio device with informationpertaining to the loudspeaker's operational environment. The mobileaudio device can adjust its sound output level based the acousticimpedance measurements. Thus, embodiments can automatically reduce thesound pressure level under conditions indicative of close acousticcoupling between the speaker and a user's ear.

Acoustic impedance is a property of a sound conducting medium. Acousticimpedance depends on the geometry, stiffness, and density of the medium.Embodiments of the present disclosure measure the acoustic impedance inthe near-field of a mobile audio device's loudspeaker. The measuredacoustic impedance describes some characteristics of the loudspeaker'senvironment. Understanding the loudspeaker's environment allowsembodiments to intelligently adjust the device's output sound level.

The acoustic impedance measurements performed by embodiments of thepresent disclosure are preferably based on a model of a system extendingfrom the electrical inputs of the mobile audio device's loudspeaker andthe ear of the user. The system can be referred to as the “ear-speakersystem.” The model preferably estimates various parameters of theacoustic impedance of the medium surrounding the loudspeaker with regardto current drawn by the speaker and voltage at the speaker inputs.

Embodiments limit the acoustic medium modeled to three physicalconfigurations representing positions of the loudspeaker relative to theuser's ear. Embodiments provide discriminating parameters relevant toeach physical configuration.

The “Free Space” configuration occurs when the user's ear is not incontact with the loudspeaker, and the loudspeaker sees the acousticimpedance of air. Temperature, moisture, and pressure are consideredconstant. Acoustic impedance in the free space configuration can bedefined as:

Z _(o)=430 Pa·s/m³.  (1)

The “Blocked” or “obstructed” configuration occurs when the loudspeakeris in contact with the user's skin, and the loudspeaker sees theacoustic impedance of water. Acoustic impedance in the blockedconfiguration can be defined as:

Z _(c)=1.5×10⁶ Pa·s/m³.  (2)

The Ear/Loudspeaker aligned (“ear aligned”) configuration occurs whenthe ear of the user is just in front of the loudspeaker and theloudspeaker sees the acoustic impedance of the ear. The ear is modeledas a small tube (i.e., the auditory canal) entering a cavity. The lengthof the tube (“l_(tube)”) is approximately one centimeter (“cm”), and theradius of the tube (“a_(tube)”) is approximately 3 millimeters (“mm”).An acoustic wavelength can be approximately 4 cm. Thus, l_(tube) anda_(tube) are within the same order of magnitude as the wavelength. Theeffect of acoustic resistance R_(A) is insignificant. The inner earcavity volume is approximately, 10⁻⁵m³, resulting in a maximumtransmission at about 4 KHz. The acoustic impedance in the ear alignedconfiguration can be expressed as:

$\begin{matrix}{{{Z_{A}(\omega)} = {R_{A} + {{\omega}\; M_{A}} + {\frac{1}{{\omega}\; C_{A}}{{Pa} \cdot s}\text{/}m^{3}}}},} & (3)\end{matrix}$

where: R_(A) is acoustic resistance, defined as R_(A)=0 Pa·s/m³,

M_(A) is acoustic mass, defined as

${M_{A} = {\frac{\rho_{0}l_{tube}}{a_{tube}^{2}\pi} = {\frac{(1.18)(0.01)}{0.003^{2}\pi}{{kg}/m^{4}}}}},$

with ρ₀ representing air density, and

C_(A) is acoustic compliance, defined as

${C_{A} = {\frac{V_{cavity}}{\gamma \; P_{0}} = {\frac{10^{- 5}}{1.4 \times 10^{5}}{Pa}\text{/}m^{3}}}},$

withV_(cavity) representing the volume of the tube between the loudspeakerand the eardrum,γ representing the ratio of specific heat which expresses variation ofdensity with temperature; andP₀ representing acoustic pressure (1 atmosphere=10⁵ Pascal).Thus, by resolving R_(A), M_(A), and C_(A) embodiments determine thegeometrical characteristics of the user's ear.

The loudspeaker is an electro-mechanical system comprising anelectrical-mechanical transformer, and a mechanical-acoustictransformer. The mechanical portion transforms the displacement andvelocity of the speaker membrane into pressure and velocity of the airresulting in sound propagation, and can be modeled as:

$\begin{matrix}{{Z_{M}\left( {\omega,Z_{user}} \right)} = {{Z_{user}S^{2}} + {\frac{1}{{\omega}\; C_{M}}.}}} & (4)\end{matrix}$

C_(M) is comparable to spring stiffness, and its value is preferablycomputed to obtain maximum energy transfer at 4 KHz, thus, C_(M)=3×10⁻⁵m/N. The loudspeaker surface is, for example, S=0.01²(π)m² for a 0.01 mspeaker radius.

The electrical portion transforms speaker current and speaker voltageinto displacement and velocity of the speaker membrane, and can bemodeled as:

$\begin{matrix}{{{Z_{E}\left( {\omega,Z_{M}} \right)} = \frac{1}{{{\omega}\; C_{E}} + \frac{1}{T_{ES}Z_{M}}}},} & (5)\end{matrix}$

where: C_(E)=10⁻⁷ Farads and T_(ES)=1.

The complete speaker-ear model is expressed as:

$\begin{matrix}{{Z_{E}(\omega)} = \frac{1}{{{\omega}\; C_{E}} + \frac{1}{{{T_{ES}\left( {R_{A} + {{\omega}\; M_{A}} + \frac{1}{{\omega}\; C_{A}}} \right)}S^{2}} + \frac{1}{{\omega}\; C_{M}}}}} & (6)\end{matrix}$

FIGS. 1A and 1B respectively show speaker voltage to current amplituderatio and phase variance across frequency for a speaker obstructed,acoustically coupled to free space, or acoustically coupled to the earof a user in accordance with various embodiments. Below 2 KHz thevoltage to current amplitude ratio, shown in FIG. 1A, is decreasing withfrequency, but does not change with the external acoustic impedance.Above 6 KHz, the voltage to current amplitude ratio increases for theear and decreases for an obstructed speaker or a speaker acousticallycoupled to free space. Some embodiments use these properties todiscriminate between an ear and an obstructed speaker or an ear and freespace.

Referring to FIG. 1B, at frequencies below 2 KHz the phase differencebetween the speaker voltage and current is not significant, but above 5KHz, the phase difference allows embodiments to discriminate between theobstructed environment and an ear or an obstructed speaker and freespace. By applying the responses shown in FIGS. 1A and/or 1B,embodiments can discriminate between ear aligned, obstructed and freespace configurations.

FIG. 2 shows an exemplary mobile audio device 200 that that controlsoutput sound pressure level in accordance with various embodiments. Themobile audio device 200 includes a loudspeaker 222, and audio circuitry204. Embodiments of the mobile audio device can also include a display206 (e.g., liquid crystal display, organic light emitting diode display,etc.), a keypad or touchpad 208 (overlaying the display in someembodiments), radio frequency circuitry, processors, memory, antennas,etc.

The audio circuitry 204 provides electrical signals to the loudspeaker222. The loudspeaker 222 converts the electrical signals into audiblesound that the user can hear. To protect the user from hearing damagecaused by exposure to excessively high levels of sound pressure, theaudio circuitry 204 includes loudness control circuitry 210 that limitsthe sound pressure level in accordance with the estimated acousticimpedance of a medium acoustically coupled to the speaker 222. In someembodiments, the loudness control circuitry estimates the acousticimpedance of the medium acoustically coupled to the speaker 222, inaccordance with the free space, blocked and ear aligned acousticimpedance conditions explained above. Embodiments preferable determinethe presence of these conditions based, at least in part, on anestimation of difference in phase of the voltage and current of theelectrical signal driving the speaker 222. As shown in FIGS. 1A and 1B,voltage/current phase differences are indicative of acoustic impedance,and thus indicative of the position of the speaker 222 relative to theear of the user. Thus, embodiments of the loudness control circuitry 210can determine when the speaker 222 is acoustically coupled to the user'sear, and reduce the output sound pressure to a safe level.

FIG. 3 shows an exemplary block diagram of a phase estimator 300 thatprovides sound level control in a mobile audio device 200 in accordancewith various embodiments. The phase estimator 300 is preferably includedin the loudness control circuitry 210. The phase estimator 300 comprisesa digital-to-analog converter (“DAC”) 304, zero crossing detectors 308,310, a counter 312, a filter 314, and a storage register 316.

A digital audio source 302 provides audio samples, for example an audiobitstream, to the DAC 304. The digital audio source 302 can be adown-link receiver of a cellular handset, a decoder that reads soundsamples from a storage device, or any other source of digital audiosamples. In some embodiments of the phase detector 300, the digitalaudio source 302 provides a signal tailored to voltage/current phasedifference measurement. For example, the digital audio source 302 canprovide a calibration tone (e.g., a 6 KHz tone). A predetermined numberof cycles of the calibration tone produced at a predetermined amplitudecan be provided to the speaker to facilitate voltage/current phasemeasurement. The calibration tone is preferably produced in a mannermaking the tone unobjectionable to the user. For example, usingpsychoacoustic masking effects, a short burst of sound is masked whengenerated a few milliseconds prior to a following sound.

The DAC 304 converts the digitized audio into an analog signal. Avoltage output 318 of the DAC 304 is provided to the zero crossingdetector 308. A current output 320 of the DAC 304 is provided to currentmeasurement circuit 306. The current measurement circuit 306 providesdrive current to the loudspeaker 222 that generates sound for a user,and provides a signal corresponding to the loudspeaker current to thezero crossing detector 310. The zero crossing detectors 308, 310identify the points at which the voltage and current signals changepolarity (i.e., transition through zero voltage or current). Theidentified zero points are provided to the counter 312.

The counter 312 determines the time between a zero detection on one ofthe voltage and current signals and a corresponding zero detection onthe other of the voltage and current signals. In some embodiments, theoutput of the zero crossing detector 308 (i.e., a voltage zero-crossing)starts the counter 312, and the output of the zero crossing detector 310stops the counter. The counter 312 is preferably clocked at a frequencythat provides adequate resolution of the phase difference between thespeaker voltage and current. In some embodiments, a 13 MHz clock isprovided to the counter 312.

The output of the counter 312, (i.e., the time between voltage andcurrent zero crossings) represents the difference in speaker voltage andcurrent phase. The counter 312 output can be filtered, in someembodiments, to, for example, reject spurious values (e.g., by use of ashort median filter). Embodiments store the filtered counter output in aregister 316, or other data storage element.

The filtered output is provided to sound level control circuitry thatlimits the sound pressure level produced by the speaker 222. If, forexample, the voltage to current time difference indicates a π/2 timedifference, an embodiment can determine that the speaker sees theimpedance of a user's ear, and that speaker 222 sound pressure levelshould be limited accordingly. If, on the other hand, no delay betweenvoltage and current zero crossings is detected, an embodiment candetermine that the speaker is driving free space, and provide acorrespondingly higher output sound pressure. Sound pressure levelscorresponding to predetermined resolution of voltage/current are storedin pre-computed look-up tables in some embodiments. Some embodimentscompute a sound pressure level at run-time based on the voltage/currentdelay.

Some embodiments of the phase detector 300 can use points on the speaker222 current and voltage signals other than zero-crossings to measurephase difference. For example, some embodiments may use peak signalvalues.

In at least some embodiments, various elements of the phase estimator300, including the DAC 304, the current measurement circuitry 306, thezero-crossing detectors 308, 310, the counter 312, the filter 314, andthe storage register 316 can be provided in a single integrated circuit.

FIG. 4 shows an exemplary block diagram of a phase estimator 400 thatprovides sound level control in a mobile audio device 200 in accordancewith various embodiments. The phase estimator 400 is preferably includedin the loudness control circuitry 210. The phase estimator 400 uses anadaptive algorithm to determine the acoustic impedance parameters of theear/speaker system model. The acoustic resistance, mass and complianceparameters, R_(A), M_(A), and C_(A), are iteratively refined to reduceerror between the measured current and a current estimate produced byprocessing a speaker voltage in the model.

The phase estimator 400 comprises a digital audio source 402, anacoustic impedance estimator 420, a current estimator 424, a complexdifferencing module 428, an acoustic parameter correction generationmodule 430, and an acoustic parameter estimator 426. The digital audiosource 402 is similar to the digital audio source 302 described above.The digital audio source 402 provides digital audio samples to both thedigital-to-analog convertor (“D/A”) 404, and to the acoustic impedanceestimator 420. The acoustic impedance estimator 420 provides an estimateof the acoustic impedance seen by the speaker 222. The estimate is basedon R_(A), M_(A), and C_(A) estimates provided by the acoustic parameterestimator 426. The acoustic impedance estimator 420 preferable estimatesacoustic impedance in accordance with equation (3) above.

The current estimator 424 generates a current estimate 432 (magnitudeand phase) based on the acoustic impedance estimate provided by theacoustic impedance estimator 420 and the audio voltage values providedby the digital audio source 402. In at least some embodiments, thecurrent estimator 424 provides a phase difference value 434, indicativeof the phase difference between the estimated current 432 and speakervoltage. The sound level control module 436 applies the phase differencevalue 434 to control the sound pressure level generated by the speaker222. In some embodiments, the sound level control module 436 estimatesthe position of the speaker relative to a user's ear in accordance withthe phase shifts illustrated in FIG. 1B.

The D/A 404 provides an analog signal to the current measurementcircuitry 406, which provides a measurement of the current driving thespeaker 222. The current measurements are digitized in analog-to-digitalconverter (“A/D”) 410.

In at least some embodiments, the ADC digitizes both currentmeasurements and audio input signals provided from an audio inputsource, such as microphone 418. The selector 408 selects an ADC inputsource in such embodiments. Digitized audio samples can be provided toother system circuitry, such as the audio sink 416, which may be, forexample, cellular uplink circuitry, audio storage, etc. The selector 414selects the audio samples provided to the audio sink 416.

The digitized measured current 412 and the estimated current 432 areprovided to a complex difference module 428. The complex differencingmodule 428 can compute the complex difference of the two currents invarious ways. For example, a fast Fourier transform, Hilbert transform,or correlation, can be used depending on the desired precision andcomplexity. The complex differencing module 428 produces an error valueindicative of the in the acoustic resistance, mass and complianceparameters, R_(A), M_(A), and C_(A). The error value is provided to theacoustic parameter correction generation module 430.

The acoustic parameter correction generation module 430 generatescorrection values to be applied to improve the accuracy of R_(A), M_(A),and C_(A), and thus improve the accuracy of the acoustic impedanceestimation. In some embodiments, the acoustic parameter correctiongeneration module 430 can use a least means squares filter to generatecorrection values. The correction values are fed to the acousticparameter estimator 426 and used to refine R_(A), M_(A), and C_(A) on asubsequent iteration.

In at least some embodiments, various modules of the phase estimator 400can be implemented by a processor executing a phase estimator softwareprogram stored in a computer readable medium. A suitable processor canbe a digital signal processor or other high-performance processor. Thecomponents of a processor are well known and can comprise executionunits (fixed point, floating point, and/or integer, etc.) instructiondecoding, data and instruction storage (registers, memory, etc.),input/output ports (e.g., memory interfaces, serial interfaces, etc.),peripherals (direct memory access controllers, timers, interruptcontrollers, communication controllers, etc.), and interconnectingbuses. A suitable computer readable medium can comprise semiconductormemory (static or dynamic random access memory, read only memory, etc.),optical storage, magnetic storage, etc. Some embodiments may implementat least some of the acoustic impedance estimator 420, the currentestimator 424, the complex differencing module 428, the acousticparameter correction generation module 430, and the acoustic parameterestimator 426 in software executing on a processor.

FIG. 5 shows a flow diagram for a method for controlling output soundlevel in a mobile audio device 200 in accordance with variousembodiments. Though depicted sequentially as a matter of convenience, atleast some of the actions shown can be performed in a different orderand/or performed in parallel. Additionally, some embodiments may performonly some of the actions shown.

In block 502, a digital audio source 302 in a mobile audio device 200,generates digital audio samples that are converted to a speaker drivesignal that actuates a speaker 222. The speaker 222 produces audio for auser. In some embodiments, the samples may compose a calibration signalof predetermined frequency and amplitude.

In block 504, the voltage of the speaker drive signal is monitored toidentify a specific point in the signal voltage. In some embodiments,the point may be a zero-crossing identified by the zero-crossingdetector 308. Other embodiments may monitor for a different point, forexample, a peak value.

In block 506, the current of the speaker drive signal is monitored toidentify a specific point in the signal current. In some embodiments,the point may be a zero-crossing identified by the zero crossingdetector 310. Other embodiments may monitor for a different point, forexample, a peak value.

In block 508, the speaker drive signal voltage/current phase and oramplitude difference is determined. A timer, for example, the counter312 can determine the voltage/current phase differential by measuringthe time between identification of a voltage signal condition (e.g., azero-crossing) and a corresponding current signal condition (e.g., azero-crossing).

In block 510, a sound level controller uses the speaker drive signalvoltage/current phase difference and/or amplitude difference to adjustspeaker 222 loudness. In at least some embodiments, the loudness isadjusted in accordance with a position of the speaker relative to theuser's ear in accordance with FIG. 1B.

FIG. 6 shows a flow diagram for a method for controlling output soundlevel in a mobile audio device 200 in accordance with variousembodiments. Some embodiments may implement the actions of FIG. 6 assoftware programming executed on a processor. Though depictedsequentially as a matter of convenience, at least some of the actionsshown can be performed in a different order and/or performed inparallel. Additionally, some embodiments may perform only some of theactions shown.

In block 602, a mobile audio device 200 is providing sound for a user.The loudness of sound produced is controlled based on the acousticimpedance seen by the speaker 222 to protect the user from excessivelyhigh sound pressure levels. The acoustic parameter estimator 426estimates the values of the acoustic parameters: acoustic resistance,R_(A), acoustic mass, M_(A), and acoustic compliance, C_(A) as definedabove.

In block 604, a digital audio source 402 in the mobile audio device,generates digital audio samples that are converted to a speaker drivesignal that actuates a speaker 222. The speaker 222 produces audio for auser. In some embodiments, the samples may compose a calibration signalof predetermined frequency and amplitude (e.g., 6 KHz in a Blackmanwindow).

In block 606, the acoustic impedance estimator 420 uses the R_(A),M_(A), and C_(A) estimates provided by the acoustic parameter estimator426 to estimate the acoustic impedance seen by the speaker 222. Theacoustic impedance is preferably estimated in accordance with equation(3) above. The acoustic impedance estimate can be used to estimate theposition of the speaker 222 relative to the user's ear.

In block 608, the current estimator 424 estimates the current (magnitudeand phase) driving the speaker 222 based on the estimated acousticimpedance and the speaker signal voltage provided by the digital audiosource 402. The current estimator 424 provides a phase difference value434, indicative of the phase difference between the estimated current432 and speaker voltage to the sound level control module 436. The soundlevel control module 436 applies the phase difference value 434 tocontrol the sound pressure level generated by the speaker 222. In someembodiments, the sound level control module 434 estimates the positionof the speaker relative to a user's ear in accordance with the phaseshifts illustrated in FIG. 1B.

In block 610, the digital audio samples are converted to an analogsignal by the D/A 404, and the speaker 222 drive current is measured inthe current measurement circuitry 406. Current measurement methods arewell known in the art, and include for example, measuring the voltagedrop across a low-valued resistor in a speaker 222 drive conductor. Themeasured current is preferably digitized in A/D 410.

In block 612, the phase and magnitude of the estimated current iscompared to the phase and magnitude of the measured current. The complexdifferencing module 428 generates a magnitude and phase for the measuredcurrent in at least some embodiments. Various methods for generating thecomplex data including Fourier transforms and Hilbert transforms can beused. Comparison of the measured and estimated currents results in acurrent error value.

In block 614, the current error value is provided to the acousticparameter correction generation module 430 where acoustic mass,resistance, and compliance value corrections are generated. Someembodiment may generate the correction values using a least mean squaresfilter. The correction values are provided to the acoustic parameterestimator 426 for use in generating refined acoustic parameters insubsequent iterations.

The above discussion is meant to be illustrative of the principles andvarious embodiments of the present invention. Numerous variations andmodifications will become apparent to those skilled in the art once theabove disclosure is fully appreciated. For example, while embodiments ofinterface detection have been described in terms of wireless devices,those skilled in the art will recognize that embodiments are alsoapplicable to other devices. It is intended that the following claims beinterpreted to embrace all such variations and modifications.

1. A system, comprising: a transducer that converts an electrical signalapplied to the transducer into audible sound; and a phase estimator thatestimates a phase difference between a voltage and a current of theelectrical signal applied to the transducer; and a sound level controlthat controls the loudness of sound produced by the transducer based, atleast in part on the estimated phase difference.
 2. The system of claim1, wherein the phase estimator measures a time difference between anidentified point of the voltage of the electrical signal and acorresponding point of the current of the electrical signal to estimatethe phase difference.
 3. The system of claim 1, wherein the phaseestimator comprises a first zero-crossing detector that detects a zerocrossing of the voltage of the electrical signal, and a secondzero-crossing detector that detects a zero-crossing of the current ofthe electrical signal.
 4. The system of claim 3, further comprising acounter that measures an elapsed time between one of the zero-crossingsof the voltage and current of the electrical signal and the other of thezero-crossings of the voltage and current of the electrical signal. 5.The system of claim 1, wherein the phase estimator estimates theacoustic impedance of a medium acoustically coupled to the transducer.6. The system of claim 1, wherein the phase estimator iterativelyestimates the acoustic impedance of a medium acoustically coupled to thetransducer.
 7. The system of claim 6, wherein the phase estimatoriteratively estimates an acoustic resistance, acoustic mass, andacoustic compliance of a user's ear, and the estimated acousticimpedance is based, at least in part, on the estimated acousticresistance, acoustic mass, and acoustic compliance.
 8. The system ofclaim 7, wherein the phase estimator iteratively estimates the acousticresistance, acoustic mass, and acoustic compliance based, at least inpart, on a phase difference between a current estimate based, at leastin part, on the estimated acoustic impedance, and the measured currentof the electrical signal applied to the transducer.
 9. A method,comprising: determining a phase difference between a voltage and currentof an electrical signal driving a speaker; and adjusting a loudness of asound produced by the speaker based, at least in part, on the phasedifference.
 10. The method of claim 9, further comprising estimating anacoustic impedance of a medium acoustically coupled to the speaker. 11.The method of claim 9, further comprising estimating speaker currentbased, at least in part, on an estimated acoustic impedance of a mediumacoustically coupled to the speaker.
 12. The method of claim 9, furthercomprising estimating an acoustic resistance, acoustic mass, andacoustic compliance of an ear of a user.
 13. The method of claim 12,further comprising iteratively updating the acoustic resistance,acoustic mass, and acoustic compliance estimate based, at least in parton a difference between an estimated speaker current derived from theacoustic resistance, acoustic mass, and acoustic compliance, and ameasured speaker current.
 14. The method of claim 9, further comprisingdetermining the phase difference by detecting a prespecified point of avoltage of the electrical signal, and a prespecified point of a currentof the electrical signal.
 15. The method of claim 14, further comprisingdetermining a time difference between the detection of the prespecifiedpoint of the voltage and detection of the prespecified point of thecurrent.
 16. A mobile audio device, comprising: an audio volume controlsystem that adjusts audio output volume based, at least in part, on adistance between an audio speaker and an auditory canal of a user. 17.The mobile audio device of claim 16, wherein the audio volume controlsystem determines the distance based, at least in part, on a phasedifference between a voltage and a current of an electrical signaldriving the audio speaker.
 18. The mobile audio device of claim 16,further comprising an audio digital-to-analog converter (“DAC”) withinwhich is integrated at least a portion of the audio volume controlsystem that determines a phase difference between a voltage and acurrent of an electrical signal driving the audio speaker.
 19. Themobile audio device of claim 16, wherein the audio volume control systemadjusts the audio output volume to no more than a maximum sound pressurelevel specified by a government regulation.
 20. The mobile audio deviceof claim 16, wherein the audio volume control computes the distance,based at least in part, on differences in acoustic impedance seen by theaudio speaker.
 21. The mobile audio device of claim 20, wherein theaudio volume control system determines the distance based, at least inpart, on differences in acoustic impedance of free air, a user's skin,and a user's auditory canal.